﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace BBPA.Admin.Controls
{
    public partial class DDL_Express : System.Web.UI.UserControl
    {
        /// <summary>
        /// CSS属性
        /// </summary>
        public string ClassName { get; set; }
        /// <summary>
        /// 选中的值
        /// </summary>
        public string SelectedValue
        {
            get { return ddl_Express.SelectedValue; }
            set { _SelectedValue = value; }
        }
        private string _SelectedValue = "";
        /// <summary>
        /// 选中的物流名称
        /// </summary>
        public string SelectedExpressName
        {
            get { return ddl_Express.SelectedItem.Text; }
            set { }
        }
        //
        BLL.Express bllExpress = new BLL.Express();
        BLL.ExpressInfo bllExpressInfo = new BLL.ExpressInfo();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                ddl_Express.DataSource = bllExpress.GetModelList("");
                ddl_Express.DataTextField = "Name";
                ddl_Express.DataValueField = "id";
                ddl_Express.DataBind();
                //
                if (ddl_Express.Items.Count == 0) return;
               
                if (_SelectedValue != "") ddl_Express.SelectedValue = _SelectedValue;
                
            } 
        }

       
    }
}